package com.uduemc.biso.core.common.feign;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.uduemc.biso.core.common.extities.CCustomerData;
import com.uduemc.biso.core.common.feign.fallback.CCustomerFeignFallback;
import com.uduemc.biso.core.utils.RestResult;

@FeignClient(value = "BISO-BASIC-SERVICE", fallback = CCustomerFeignFallback.class)
@RequestMapping(value = "/common/customer")
public interface CCustomerFeign {

	/**
	 * 新增 客户以及其主机信息
	 * 
	 * @return
	 */
	@PostMapping("/append")
	public RestResult append(@RequestBody CCustomerData customerData);

	/**
	 * 通过id 以及 agentId 获取 CHostListCustomerData数据
	 * 
	 * @return
	 */
	@GetMapping("/info/{id}/{agentId}")
	public RestResult info(@PathVariable("id") long id, @PathVariable("agentId") long agentId);

	/**
	 * 条件查询获取CHostListCustomerData数据
	 * 
	 * @param agentId
	 * @param username
	 * @param numberKey
	 * @param status
	 * @param pageNumber
	 * @param pageSize
	 * @return
	 */
	@PostMapping("/infos")
	public RestResult infos(@RequestParam("agentId") long agentId, @RequestParam("username") String username,
			@RequestParam("numberKey") String numberKey, @RequestParam("status") short status,
			@RequestParam("pageNumber") int pageNumber, @RequestParam("pageSize") int pageSize);
}
